#pragma once
#include "Filter.h"
#include "EQFilter.h"
#include <thread>

#define EQ_LEN (10)
//100 200 500 1k 2k 4k 8k 10k
class Equalizer
{
public:
	Equalizer();
	~Equalizer();
	void setGain(unsigned int freq, unsigned int gain);
	std::vector<float> EqProcess(std::vector<float> &data);

private:
	int m_gain[EQ_LEN];
	Filter m_filter[EQ_LEN];
	EQFilter m_eq;
	int m_calc_finished;
	std::mutex m_calc_mutex;
	std::thread m_work_thread[EQ_LEN];
	std::vector<float> m_calc_data[EQ_LEN];

	void calcFilterResult(std::vector<float> &data, unsigned int count);
	void filterInit();
};

